package com.hlkj.pay.app.merchant.ext.impl.yeepay.dto;


/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.util.List;

import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2025/04/07 11:03
 */
@Data
public class YeePayDivideNotify {
    /**
     * 发起方商编
     */
    private String parentMerchantNo;

    /**
     * 商户编号
     */
    private String merchantNo;

    /**
     * 商户收款请求号
     */
    private String orderId ;

    /**
     * 易宝收款订单号
     */
    private String uniqueOrderNo;

    /**
     * 商户分账请求号
     */
    private String divideRequestId;

    private String divideDetail;

    /**
     * 分账详情
     */
    private List<YeePayDivideDetailResp> divideDetails;

    /**
     * 分账状态
     * SUCCESS(“成功”)
     * FAIL(“失败”)
     */
    private String divideStatus;

    /**
     * 分账失败原因，divideStatus = FAIL 时该字段才可能有值
     */
    private String failReason;

    public List<YeePayDivideDetailResp> getDivideDetails() {
        if(StrUtil.isNotEmpty(divideDetail)){
            divideDetails = JSONUtil.toList(divideDetail,YeePayDivideDetailResp.class);
        }

        return divideDetails;
    }
}
